package com.example.spring.rabbitmq.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * TODO
 *
 * @Description
 * @Author zhengmw
 * @Data 2024/5/16 10:01
 */
public enum MQSendEnum {
    /**
     * 租金异常单，改卡返回结果
     */
    RENT_CARD_CHANGE_RESULT("TOPIC",
            "EX.TOPIC.AFTER_RENT.PS_CHANGE_STATUS_CHANGE",
            "MQ.AFTER_RENT.POWER_OPERATION_SYSTEM.PS_CHANGE_STATUS_CHANGE",
            "RK.PS_CHANGE_STATUS_CHANGE",
            null),
    /**
     * 创建工单
     */
    WORD_ORDER_CREATE("DIRECT",
            "EX.DIRECT.XUNTIAN.WORD_ORDER",
            "MQ.XUNTIAN.WORD_ORDER_CREATE_TEST",
            "PK.XUNTIAN.WORD_ORDER_CREATE_TEST",
            null)
    ;

    public final String exchangeType;

    public final String exchange;

    public final String queue;

    public final String routing;

    public final MapArgs queueArgs;

    MQSendEnum(String exchangeType, String exchange, String queue, String routing, MapArgs queueArgs) {
        this.exchangeType = exchangeType;
        this.exchange = exchange;
        this.queue = queue;
        this.routing = routing;
        this.queueArgs = queueArgs;
    }

    public static class MapArgs {

        private final Map<String, Object> map = new HashMap<>();

        public MapArgs put(String key, Object value) {
            this.map.put(key, value);
            return this;
        }

        public Map<String, Object> get() {
            return this.map;
        }
    }
}

